import {mat4, vec2, vec3, vec4} from 'gl-matrix';

export function printVec(vec: number[] | vec3 | vec4 | vec2) {
  let vecStr = Array.from(vec).
    map(x => x.toFixed(2).
      padStart(5, ' ')).
    join(', ');
  return `${vecStr}`;
}

export function printMat4(mat: mat4) {
  let nums = Array.from(mat).
    map(x => x.toFixed(2).
      padStart(5, ' '));
  return `${nums.slice(0, 4).
    join(' ')}
${nums.slice(4, 8).
    join(' ')}
${nums.slice(8, 12).
    join(' ')}
${nums.slice(12, 16).
    join(' ')}`;
}
